package com.cn.yds.bdy.vo;

import com.cn.yds.bdy.dao.model.UserModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.Assert;

import java.io.Serializable;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StudentVo implements Serializable {

    private Integer id;

    private String studentId;

    private String name;

    private String academy;

    private String major;

    private String grade;

    private String gender;

    private String description;

    public StudentVo(UserModel userModel) {
        Assert.notNull(userModel,"userModel can't be empty");
        this.id = userModel.getId();
        this.studentId = userModel.getLoginId();
        this.name = userModel.getName();
        this.academy = userModel.getAcademy();
        this.major = userModel.getMajor();
        this.grade = userModel.getGrade();
        this.gender = userModel.getGender();
        this.description = userModel.getDescription();
    }
}
